import  wx


class BugReport(wx.Dialog):
    def __init__(
            self, parent, ID, title, size=wx.DefaultSize, pos=wx.DefaultPosition, 
            style=wx.DEFAULT_DIALOG_STYLE,
            useMetal=False,
            ):
        
        pre = wx.PreDialog()
        pre.Create(parent, ID, title, pos, size, style)

        self.PostCreate(pre)

        # Now continue with the normal construction of the dialog
        # contents
        sizer = wx.BoxSizer(wx.VERTICAL)

        label = wx.StaticText(self, -1, "             Please describe the problem as detailed as possible.")
        sizer.Add(label, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
        #--------------------------------------------------------------------------------------
        box = wx.BoxSizer(wx.HORIZONTAL)

        label = wx.StaticText(self, -1, "Name: ")
        box.Add(label, 0, wx.ALIGN_CENTRE|wx.ALL, 5)

        self.text_name = wx.TextCtrl(self, -1, "", size=(80,-1))
        box.Add(self.text_name, 1, wx.ALIGN_CENTRE|wx.ALL, 5)

        sizer.Add(box, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
        #--------------------------------------------------------------------------------------
        box = wx.BoxSizer(wx.HORIZONTAL)

        label = wx.StaticText(self, -1, "E-Mail:")
        box.Add(label, 0, wx.ALIGN_CENTRE|wx.ALL, 5)

        self.text_mail = wx.TextCtrl(self, -1, "", size=(80,-1))
        box.Add(self.text_mail, 1, wx.ALIGN_CENTRE|wx.ALL, 5)

        sizer.Add(box, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
        #--------------------------------------------------------------------------------------
        box = wx.BoxSizer(wx.HORIZONTAL)

        label = wx.StaticText(self, -1, "          ")
        box.Add(label, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
        self.text_problem = wx.TextCtrl(self, -1, "", size=(300,300), style=wx.TE_MULTILINE)
        box.Add(self.text_problem, 1, wx.ALIGN_CENTRE|wx.ALL, 5)

        sizer.Add(box, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
        #--------------------------------------------------------------------------------------
        line = wx.StaticLine(self, -1, size=(20,-1), style=wx.LI_HORIZONTAL)
        sizer.Add(line, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.RIGHT|wx.TOP, 5)

        btnsizer = wx.StdDialogButtonSizer()
        
        btn = wx.Button(self, wx.ID_OK)
        btn.SetDefault()
        btnsizer.AddButton(btn)

        btn = wx.Button(self, wx.ID_CANCEL)
        btnsizer.AddButton(btn)
        btnsizer.Realize()

        sizer.Add(btnsizer, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)

        self.SetSizer(sizer)
        sizer.Fit(self)